package com.greenhouse9.prog05.mypackage;

import java.util.HashMap;

public class Model01 implements java.io.Serializable {
    private String value01 = null;
	private String value02 = null;
	private String arg01   = null;
	private int kekka = 0;
	private HashMap<String, String> httpParams = new HashMap<String, String>();
	private Entity e = null;

	public Model01(){
	}

	public void kakezan () {
		try {
			kekka = Integer.parseInt(value01)*Integer.parseInt(value02);
		}
		catch(NumberFormatException ex){
			kekka = 1;
		}
	}

	public String getValue01() { return value01; }
	public void setValue01(String value01){
		this.value01 = value01;
	}

	public String getValue02() { return value02; }
	public void setValue02(String value02){
		this.value02 = value02;
	}

	public String getArg01() { return arg01; }
	public void setArg01(String arg01){
		this.arg01 = arg01;
	}
	public int getKekka() {return kekka;}

	public HashMap<String, String> getHttpParams () {
		return httpParams;
	}
	public void setHttpParams (HashMap<String, String> httpParams){
		this.httpParams = httpParams;
	}

	public void createEntity(){

		Service svc = new Service(httpParams);
		e = svc.doService();

	}

	public Entity getEntity(){
		return e;
	}

/*
	public void runService(){
		String serviceName = httpParams.get("service");
		ServiceFactrory svcFact = new ServiceFactory();
		Service svc = svcFact.create(srviceName);
		entity = svc.doService();
	}
*/
}
